import type { RouteRecordRaw } from 'vue-router'

const todoRoutes: RouteRecordRaw = {
  path: '/todo',
  component: () => import('./views/index.vue'),
  children: [
    {
      path: '',
      name: 'TodoHome',
      component: () => import('./views/Home.vue'),
      meta: {
        title: '待办计划',
        requiresAuth: true
      }
    },
    {
      path: 'create',
      name: 'TodoCreate',
      component: () => import('./views/TodoForm.vue'),
      meta: {
        title: '新建待办事项',
        requiresAuth: true
      }
    },
    {
      path: 'detail/:id',
      name: 'TodoDetail',
      component: () => import('./views/Detail.vue'),
      meta: {
        title: '待办详情',
        requiresAuth: true
      }
    },
    {
      path: 'edit/:id',
      name: 'TodoEdit',
      component: () => import('./views/TodoForm.vue'),
      meta: {
        title: '编辑待办事项',
        requiresAuth: true
      }
    }
  ]
}

export default todoRoutes